﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract PutniNalogStavkaPrijevoz typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PutniNalogStavkaPrijevozDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<PutniNalogStavkaPrijevozDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.PutniNalogStavkaPrijevoz _currentPutniNalogStavkaPrijevoz = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxPutniNalogStavkaPrijevozDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxPutniNalogStavkaPrijevozErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxPutniNalogStavkaPrijevozBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDPutniNalog property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDPutniNalogDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDVozilo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDVoziloDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RelacijaOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRelacijaOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RelacijaDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRelacijaDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Kilometara property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKilometaraDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the BrojiloPocetak property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBrojiloPocetakDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the BrojiloKraj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBrojiloKrajDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PoKm property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPoKmDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the VoziloOpis property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxVoziloOpisDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDKontoPrijevoza property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDKontoPrijevozaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDBlagajnaStavka property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDBlagajnaStavkaDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Konto> _IDKontoPrijevozaList;
		
		/// <summary> 
		/// The list of selectable Konto
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Konto> IDKontoPrijevozaList
		{
			get {return this._IDKontoPrijevozaList;}
			set 
			{
				this._IDKontoPrijevozaList = value;
				this.uxIDKontoPrijevozaDataGridViewColumn.DataSource = null;
				this.uxIDKontoPrijevozaDataGridViewColumn.DataSource = this._IDKontoPrijevozaList;
			}
		}
		
		private bool _allowNewItemInIDKontoPrijevozaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Konto
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKontoPrijevozaList
		{
			get { return _allowNewItemInIDKontoPrijevozaList;}
			set
			{
				this._allowNewItemInIDKontoPrijevozaList = value;
				this.uxIDKontoPrijevozaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.PutniNalog> _IDPutniNalogList;
		
		/// <summary> 
		/// The list of selectable PutniNalog
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.PutniNalog> IDPutniNalogList
		{
			get {return this._IDPutniNalogList;}
			set 
			{
				this._IDPutniNalogList = value;
				this.uxIDPutniNalogDataGridViewColumn.DataSource = null;
				this.uxIDPutniNalogDataGridViewColumn.DataSource = this._IDPutniNalogList;
			}
		}
		
		private bool _allowNewItemInIDPutniNalogList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of PutniNalog
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDPutniNalogList
		{
			get { return _allowNewItemInIDPutniNalogList;}
			set
			{
				this._allowNewItemInIDPutniNalogList = value;
				this.uxIDPutniNalogDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Vozilo> _IDVoziloList;
		
		/// <summary> 
		/// The list of selectable Vozilo
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Vozilo> IDVoziloList
		{
			get {return this._IDVoziloList;}
			set 
			{
				this._IDVoziloList = value;
				this.uxIDVoziloDataGridViewColumn.DataSource = null;
				this.uxIDVoziloDataGridViewColumn.DataSource = this._IDVoziloList;
			}
		}
		
		private bool _allowNewItemInIDVoziloList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Vozilo
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDVoziloList
		{
			get { return _allowNewItemInIDVoziloList;}
			set
			{
				this._allowNewItemInIDVoziloList = value;
				this.uxIDVoziloDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.PutniNalogStavkaPrijevoz> _PutniNalogStavkaPrijevozList;
				
		/// <summary> 
		/// The list of PutniNalogStavkaPrijevoz to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.PutniNalogStavkaPrijevoz> PutniNalogStavkaPrijevozList
		{
			get {return this._PutniNalogStavkaPrijevozList;}
			set
			{
				this._PutniNalogStavkaPrijevozList = value;
				this.uxPutniNalogStavkaPrijevozBindingSource.DataSource = null;
				this.uxPutniNalogStavkaPrijevozBindingSource.DataSource = value;
				this.uxPutniNalogStavkaPrijevozDataGridView.DataSource = null;
				this.uxPutniNalogStavkaPrijevozDataGridView.DataSource = this.uxPutniNalogStavkaPrijevozBindingSource;				
				//this.uxPutniNalogStavkaPrijevozBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxPutniNalogStavkaPrijevozBindingSource_ListChanged);
				this.uxPutniNalogStavkaPrijevozBindingSource.CurrentItemChanged += new System.EventHandler(OnPutniNalogStavkaPrijevozBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnPutniNalogStavkaPrijevozBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentPutniNalogStavkaPrijevoz = uxPutniNalogStavkaPrijevozBindingSource.Current as Entities.PutniNalogStavkaPrijevoz;
			
			if (_currentPutniNalogStavkaPrijevoz != null)
			{
				_currentPutniNalogStavkaPrijevoz.Validate();
			}
			//_PutniNalogStavkaPrijevoz.Validate();
			OnCurrentEntityChanged();
		}

		//void uxPutniNalogStavkaPrijevozBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.PutniNalogStavkaPrijevoz"/> instance.
		/// </summary>
		public Entities.PutniNalogStavkaPrijevoz SelectedPutniNalogStavkaPrijevoz
		{
			get {return this._currentPutniNalogStavkaPrijevoz;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxPutniNalogStavkaPrijevozDataGridView.VirtualMode;}
			set
			{
				this.uxPutniNalogStavkaPrijevozDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxPutniNalogStavkaPrijevozDataGridView.AllowUserToAddRows;}
			set {this.uxPutniNalogStavkaPrijevozDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxPutniNalogStavkaPrijevozDataGridView.AllowUserToDeleteRows;}
			set {this.uxPutniNalogStavkaPrijevozDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxPutniNalogStavkaPrijevozDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxPutniNalogStavkaPrijevozDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="PutniNalogStavkaPrijevozDataGridViewBase"/> class.
		/// </summary>
		public PutniNalogStavkaPrijevozDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxPutniNalogStavkaPrijevozDataGridView = new System.Windows.Forms.DataGridView();
			this.uxPutniNalogStavkaPrijevozBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxPutniNalogStavkaPrijevozErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDPutniNalogDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDVoziloDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxRelacijaOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxRelacijaDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxKilometaraDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxBrojiloPocetakDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxBrojiloKrajDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPoKmDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxVoziloOpisDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDKontoPrijevozaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDBlagajnaStavkaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDKontoPrijevozaBindingSource = new KontoBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKontoPrijevozaBindingSource)).BeginInit();
			//this.uxIDPutniNalogBindingSource = new PutniNalogBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPutniNalogBindingSource)).BeginInit();
			//this.uxIDVoziloBindingSource = new VoziloBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDVoziloBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxPutniNalogStavkaPrijevozErrorProvider
			// 
			this.uxPutniNalogStavkaPrijevozErrorProvider.ContainerControl = this;
			this.uxPutniNalogStavkaPrijevozErrorProvider.DataSource = this.uxPutniNalogStavkaPrijevozBindingSource;						
			// 
			// uxPutniNalogStavkaPrijevozDataGridView
			// 
			this.uxPutniNalogStavkaPrijevozDataGridView.AutoGenerateColumns = false;
			this.uxPutniNalogStavkaPrijevozDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxPutniNalogStavkaPrijevozDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDPutniNalogDataGridViewColumn,
		this.uxIDVoziloDataGridViewColumn,
		this.uxRelacijaOdDataGridViewColumn,
		this.uxRelacijaDoDataGridViewColumn,
		this.uxKilometaraDataGridViewColumn,
		this.uxBrojiloPocetakDataGridViewColumn,
		this.uxBrojiloKrajDataGridViewColumn,
		this.uxPoKmDataGridViewColumn,
		this.uxVoziloOpisDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxIDKontoPrijevozaDataGridViewColumn,
		this.uxIDBlagajnaStavkaDataGridViewColumn			});
			this.uxPutniNalogStavkaPrijevozDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxPutniNalogStavkaPrijevozDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxPutniNalogStavkaPrijevozDataGridView.Name = "uxPutniNalogStavkaPrijevozDataGridView";
			this.uxPutniNalogStavkaPrijevozDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxPutniNalogStavkaPrijevozDataGridView.TabIndex = 0;	
			this.uxPutniNalogStavkaPrijevozDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxPutniNalogStavkaPrijevozDataGridView.EnableHeadersVisualStyles = false;
			this.uxPutniNalogStavkaPrijevozDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnPutniNalogStavkaPrijevozDataGridViewDataError);
			this.uxPutniNalogStavkaPrijevozDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnPutniNalogStavkaPrijevozDataGridViewCellValueNeeded);
			this.uxPutniNalogStavkaPrijevozDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnPutniNalogStavkaPrijevozDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDPutniNalogDataGridViewColumn
			//
			this.uxIDPutniNalogDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDPutniNalogDataGridViewColumn.DataPropertyName = "IDPutniNalog";
			this.uxIDPutniNalogDataGridViewColumn.HeaderText = "IDPutniNalog";
			this.uxIDPutniNalogDataGridViewColumn.Name = "uxIDPutniNalogDataGridViewColumn";
			this.uxIDPutniNalogDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDPutniNalogDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDPutniNalogDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDVoziloDataGridViewColumn
			//
			this.uxIDVoziloDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDVoziloDataGridViewColumn.DataPropertyName = "IDVozilo";
			this.uxIDVoziloDataGridViewColumn.HeaderText = "IDVozilo";
			this.uxIDVoziloDataGridViewColumn.Name = "uxIDVoziloDataGridViewColumn";
			this.uxIDVoziloDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDVoziloDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDVoziloDataGridViewColumn.ReadOnly = false;		
			//
			// uxRelacijaOdDataGridViewColumn
			//
			this.uxRelacijaOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRelacijaOdDataGridViewColumn.DataPropertyName = "RelacijaOd";
			this.uxRelacijaOdDataGridViewColumn.HeaderText = "RelacijaOd";
			this.uxRelacijaOdDataGridViewColumn.Name = "uxRelacijaOdDataGridViewColumn";
			this.uxRelacijaOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRelacijaOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRelacijaOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxRelacijaDoDataGridViewColumn
			//
			this.uxRelacijaDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRelacijaDoDataGridViewColumn.DataPropertyName = "RelacijaDo";
			this.uxRelacijaDoDataGridViewColumn.HeaderText = "RelacijaDo";
			this.uxRelacijaDoDataGridViewColumn.Name = "uxRelacijaDoDataGridViewColumn";
			this.uxRelacijaDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRelacijaDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRelacijaDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxKilometaraDataGridViewColumn
			//
			this.uxKilometaraDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKilometaraDataGridViewColumn.DataPropertyName = "Kilometara";
			this.uxKilometaraDataGridViewColumn.HeaderText = "Kilometara";
			this.uxKilometaraDataGridViewColumn.Name = "uxKilometaraDataGridViewColumn";
			this.uxKilometaraDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKilometaraDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKilometaraDataGridViewColumn.ReadOnly = false;		
			//
			// uxBrojiloPocetakDataGridViewColumn
			//
			this.uxBrojiloPocetakDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBrojiloPocetakDataGridViewColumn.DataPropertyName = "BrojiloPocetak";
			this.uxBrojiloPocetakDataGridViewColumn.HeaderText = "BrojiloPocetak";
			this.uxBrojiloPocetakDataGridViewColumn.Name = "uxBrojiloPocetakDataGridViewColumn";
			this.uxBrojiloPocetakDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBrojiloPocetakDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBrojiloPocetakDataGridViewColumn.ReadOnly = false;		
			//
			// uxBrojiloKrajDataGridViewColumn
			//
			this.uxBrojiloKrajDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBrojiloKrajDataGridViewColumn.DataPropertyName = "BrojiloKraj";
			this.uxBrojiloKrajDataGridViewColumn.HeaderText = "BrojiloKraj";
			this.uxBrojiloKrajDataGridViewColumn.Name = "uxBrojiloKrajDataGridViewColumn";
			this.uxBrojiloKrajDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBrojiloKrajDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBrojiloKrajDataGridViewColumn.ReadOnly = false;		
			//
			// uxPoKmDataGridViewColumn
			//
			this.uxPoKmDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPoKmDataGridViewColumn.DataPropertyName = "PoKm";
			this.uxPoKmDataGridViewColumn.HeaderText = "PoKm";
			this.uxPoKmDataGridViewColumn.Name = "uxPoKmDataGridViewColumn";
			this.uxPoKmDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPoKmDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPoKmDataGridViewColumn.ReadOnly = false;		
			//
			// uxVoziloOpisDataGridViewColumn
			//
			this.uxVoziloOpisDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxVoziloOpisDataGridViewColumn.DataPropertyName = "VoziloOpis";
			this.uxVoziloOpisDataGridViewColumn.HeaderText = "VoziloOpis";
			this.uxVoziloOpisDataGridViewColumn.Name = "uxVoziloOpisDataGridViewColumn";
			this.uxVoziloOpisDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxVoziloOpisDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxVoziloOpisDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDKontoPrijevozaDataGridViewColumn
			//
			this.uxIDKontoPrijevozaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKontoPrijevozaDataGridViewColumn.DataPropertyName = "IDKontoPrijevoza";
			this.uxIDKontoPrijevozaDataGridViewColumn.HeaderText = "IDKontoPrijevoza";
			this.uxIDKontoPrijevozaDataGridViewColumn.Name = "uxIDKontoPrijevozaDataGridViewColumn";
			this.uxIDKontoPrijevozaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKontoPrijevozaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKontoPrijevozaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDBlagajnaStavkaDataGridViewColumn
			//
			this.uxIDBlagajnaStavkaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDBlagajnaStavkaDataGridViewColumn.DataPropertyName = "IDBlagajnaStavka";
			this.uxIDBlagajnaStavkaDataGridViewColumn.HeaderText = "IDBlagajnaStavka";
			this.uxIDBlagajnaStavkaDataGridViewColumn.Name = "uxIDBlagajnaStavkaDataGridViewColumn";
			this.uxIDBlagajnaStavkaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDBlagajnaStavkaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDBlagajnaStavkaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDKontoPrijevozaDataGridViewColumn
			//				
			this.uxIDKontoPrijevozaDataGridViewColumn.DisplayMember = "Sifra";	
			this.uxIDKontoPrijevozaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDKontoPrijevozaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDKontoPrijevozaDataGridViewColumn.DataSource = uxIDKontoPrijevozaBindingSource;				
				
			//
			// uxIDPutniNalogDataGridViewColumn
			//				
			this.uxIDPutniNalogDataGridViewColumn.DisplayMember = "Oznaka";	
			this.uxIDPutniNalogDataGridViewColumn.ValueMember = "ID";	
			this.uxIDPutniNalogDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDPutniNalogDataGridViewColumn.DataSource = uxIDPutniNalogBindingSource;				
				
			//
			// uxIDVoziloDataGridViewColumn
			//				
			this.uxIDVoziloDataGridViewColumn.DisplayMember = "OznakaVozila";	
			this.uxIDVoziloDataGridViewColumn.ValueMember = "ID";	
			this.uxIDVoziloDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDVoziloDataGridViewColumn.DataSource = uxIDVoziloBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxPutniNalogStavkaPrijevozDataGridView);
			this.Name = "PutniNalogStavkaPrijevozDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKontoPrijevozaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPutniNalogBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDVoziloBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogStavkaPrijevozBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				PutniNalogStavkaPrijevozDataGridViewEventArgs args = new PutniNalogStavkaPrijevozDataGridViewEventArgs();
				args.PutniNalogStavkaPrijevoz = _currentPutniNalogStavkaPrijevoz;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class PutniNalogStavkaPrijevozDataGridViewEventArgs : System.EventArgs
		{
			private Entities.PutniNalogStavkaPrijevoz	_PutniNalogStavkaPrijevoz;
	
			/// <summary>
			/// the  Entities.PutniNalogStavkaPrijevoz instance.
			/// </summary>
			public Entities.PutniNalogStavkaPrijevoz PutniNalogStavkaPrijevoz
			{
				get { return _PutniNalogStavkaPrijevoz; }
				set { _PutniNalogStavkaPrijevoz = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxPutniNalogStavkaPrijevozDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogStavkaPrijevozDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxPutniNalogStavkaPrijevozDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogStavkaPrijevozDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxPutniNalogStavkaPrijevozDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].ID;
						break;
					case "uxIDPutniNalogDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].IDPutniNalog;
						break;
					case "uxIDVoziloDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].IDVozilo;
						break;
					case "uxRelacijaOdDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].RelacijaOd;
						break;
					case "uxRelacijaDoDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].RelacijaDo;
						break;
					case "uxKilometaraDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].Kilometara;
						break;
					case "uxBrojiloPocetakDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].BrojiloPocetak;
						break;
					case "uxBrojiloKrajDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].BrojiloKraj;
						break;
					case "uxPoKmDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].PoKm;
						break;
					case "uxVoziloOpisDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].VoziloOpis;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].Iznos;
						break;
					case "uxIDKontoPrijevozaDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].IDKontoPrijevoza;
						break;
					case "uxIDBlagajnaStavkaDataGridViewColumn":
						e.Value = PutniNalogStavkaPrijevozList[e.RowIndex].IDBlagajnaStavka;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxPutniNalogStavkaPrijevozDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogStavkaPrijevozDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxPutniNalogStavkaPrijevozDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDPutniNalogDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].IDPutniNalog = (System.Int32)e.Value;
						break;
					case "uxIDVoziloDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].IDVozilo = (System.Int32?)e.Value;
						break;
					case "uxRelacijaOdDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].RelacijaOd = (System.String)e.Value;
						break;
					case "uxRelacijaDoDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].RelacijaDo = (System.String)e.Value;
						break;
					case "uxKilometaraDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].Kilometara = (System.Decimal)e.Value;
						break;
					case "uxBrojiloPocetakDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].BrojiloPocetak = (System.Decimal?)e.Value;
						break;
					case "uxBrojiloKrajDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].BrojiloKraj = (System.Decimal?)e.Value;
						break;
					case "uxPoKmDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].PoKm = (System.Decimal)e.Value;
						break;
					case "uxVoziloOpisDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].VoziloOpis = (System.String)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].Iznos = (System.Decimal?)e.Value;
						break;
					case "uxIDKontoPrijevozaDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].IDKontoPrijevoza = (System.Int32?)e.Value;
						break;
					case "uxIDBlagajnaStavkaDataGridViewColumn":
						PutniNalogStavkaPrijevozList[e.RowIndex].IDBlagajnaStavka = (System.Int32?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
